3.35 \(\int \csc ^5(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=79 \[ -\frac {3 (a+4 b) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac {(5 a+4 b) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a \cot ^3(e+f x) \csc (e+f x)}{4 f}+\frac {b \sec (e+f x)}{f} \]

[Out]

-3/8*(a+4*b)*arctanh(cos(f*x+e))/f-1/8*(5*a+4*b)*cot(f*x+e)*csc(f*x+e)/f-1/4*a*cot(f*x+e)^3*csc(f*x+e)/f+b*sec
(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3664, 455, 1157, 388, 207} \[ -\frac {3 (a+4 b) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac {(5 a+4 b) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a \cot ^3(e+f x) \csc (e+f x)}{4 f}+\frac {b \sec (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^5*(a + b*Tan[e + f*x]^2),x]

[Out]

(-3*(a + 4*b)*ArcTanh[Cos[e + f*x]])/(8*f) - ((5*a + 4*b)*Cot[e + f*x]*Csc[e + f*x])/(8*f) - (a*Cot[e + f*x]^3
*Csc[e + f*x])/(4*f) + (b*Sec[e + f*x])/f

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 455

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[((-a)^(m/2 - 1)*(b*c - a*d)*
x*(a + b*x^2)^(p + 1))/(2*b^(m/2 + 1)*(p + 1)), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[(a + b*x^2)^(p + 1)*E
xpandToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)]
- (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[
m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 1157

Int[((d_) + (e_.)*(x_)^2)^(q_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> With[{Qx = PolynomialQ
uotient[(a + b*x^2 + c*x^4)^p, d + e*x^2, x], R = Coeff[PolynomialRemainder[(a + b*x^2 + c*x^4)^p, d + e*x^2,
x], x, 0]}, -Simp[(R*x*(d + e*x^2)^(q + 1))/(2*d*(q + 1)), x] + Dist[1/(2*d*(q + 1)), Int[(d + e*x^2)^(q + 1)*
ExpandToSum[2*d*(q + 1)*Qx + R*(2*q + 3), x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && N
eQ[c*d^2 - b*d*e + a*e^2, 0] && IGtQ[p, 0] && LtQ[q, -1]

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \csc ^5(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^4 \left (a-b+b x^2\right )}{\left (-1+x^2\right )^3} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {a \cot ^3(e+f x) \csc (e+f x)}{4 f}-\frac {\operatorname {Subst}\left (\int \frac {-a-4 a x^2-4 b x^4}{\left (-1+x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{4 f}\\ &=-\frac {(5 a+4 b) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a \cot ^3(e+f x) \csc (e+f x)}{4 f}-\frac {\operatorname {Subst}\left (\int \frac {-3 a-4 b-8 b x^2}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{8 f}\\ &=-\frac {(5 a+4 b) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a \cot ^3(e+f x) \csc (e+f x)}{4 f}+\frac {b \sec (e+f x)}{f}+\frac {(3 (a+4 b)) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{8 f}\\ &=-\frac {3 (a+4 b) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac {(5 a+4 b) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a \cot ^3(e+f x) \csc (e+f x)}{4 f}+\frac {b \sec (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 6.06, size = 276, normalized size = 3.49 \[ -\frac {a \csc ^4\left (\frac {1}{2} (e+f x)\right )}{64 f}-\frac {3 a \csc ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}+\frac {a \sec ^4\left (\frac {1}{2} (e+f x)\right )}{64 f}+\frac {3 a \sec ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {b \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {b \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {3 b \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}-\frac {3 b \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {b \sin \left (\frac {1}{2} (e+f x)\right )}{f \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}-\frac {b \sin \left (\frac {1}{2} (e+f x)\right )}{f \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^5*(a + b*Tan[e + f*x]^2),x]

[Out]

(-3*a*Csc[(e + f*x)/2]^2)/(32*f) - (b*Csc[(e + f*x)/2]^2)/(8*f) - (a*Csc[(e + f*x)/2]^4)/(64*f) - (3*a*Log[Cos
[(e + f*x)/2]])/(8*f) - (3*b*Log[Cos[(e + f*x)/2]])/(2*f) + (3*a*Log[Sin[(e + f*x)/2]])/(8*f) + (3*b*Log[Sin[(
e + f*x)/2]])/(2*f) + (3*a*Sec[(e + f*x)/2]^2)/(32*f) + (b*Sec[(e + f*x)/2]^2)/(8*f) + (a*Sec[(e + f*x)/2]^4)/
(64*f) + (b*Sin[(e + f*x)/2])/(f*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])) - (b*Sin[(e + f*x)/2])/(f*(Cos[(e + f*
x)/2] + Sin[(e + f*x)/2]))

________________________________________________________________________________________

fricas [B]  time = 0.70, size = 178, normalized size = 2.25 \[ \frac {6 \, {\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{4} - 10 \, {\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{2} - 3 \, {\left ({\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{5} - 2 \, {\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{3} + {\left (a + 4 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 3 \, {\left ({\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{5} - 2 \, {\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{3} + {\left (a + 4 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 16 \, b}{16 \, {\left (f \cos \left (f x + e\right )^{5} - 2 \, f \cos \left (f x + e\right )^{3} + f \cos \left (f x + e\right )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/16*(6*(a + 4*b)*cos(f*x + e)^4 - 10*(a + 4*b)*cos(f*x + e)^2 - 3*((a + 4*b)*cos(f*x + e)^5 - 2*(a + 4*b)*cos
(f*x + e)^3 + (a + 4*b)*cos(f*x + e))*log(1/2*cos(f*x + e) + 1/2) + 3*((a + 4*b)*cos(f*x + e)^5 - 2*(a + 4*b)*
cos(f*x + e)^3 + (a + 4*b)*cos(f*x + e))*log(-1/2*cos(f*x + e) + 1/2) + 16*b)/(f*cos(f*x + e)^5 - 2*f*cos(f*x
+ e)^3 + f*cos(f*x + e))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(-b/((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))-1)+(-18*((1-c
os(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a-72*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*b-8*(1-cos(f*x+exp(1))
)/(1+cos(f*x+exp(1)))*a-8*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b-a)*1/128/((1-cos(f*x+exp(1)))/(1+cos(f*x+e
xp(1))))^2+(32*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a+256*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+256
*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b)/4096+(3*a+12*b)/32*ln(abs(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1))
)))

________________________________________________________________________________________

maple [A]  time = 0.53, size = 120, normalized size = 1.52 \[ -\frac {a \cot \left (f x +e \right ) \left (\csc ^{3}\left (f x +e \right )\right )}{4 f}-\frac {3 a \cot \left (f x +e \right ) \csc \left (f x +e \right )}{8 f}+\frac {3 a \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8 f}-\frac {b}{2 f \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {3 b}{2 f \cos \left (f x +e \right )}+\frac {3 b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^5*(a+b*tan(f*x+e)^2),x)

[Out]

-1/4/f*a*cot(f*x+e)*csc(f*x+e)^3-3/8*a*cot(f*x+e)*csc(f*x+e)/f+3/8/f*a*ln(csc(f*x+e)-cot(f*x+e))-1/2/f*b/sin(f
*x+e)^2/cos(f*x+e)+3/2/f*b/cos(f*x+e)+3/2/f*b*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.58, size = 101, normalized size = 1.28 \[ -\frac {3 \, {\left (a + 4 \, b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, {\left (a + 4 \, b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left (3 \, {\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{4} - 5 \, {\left (a + 4 \, b\right )} \cos \left (f x + e\right )^{2} + 8 \, b\right )}}{\cos \left (f x + e\right )^{5} - 2 \, \cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )}}{16 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/16*(3*(a + 4*b)*log(cos(f*x + e) + 1) - 3*(a + 4*b)*log(cos(f*x + e) - 1) - 2*(3*(a + 4*b)*cos(f*x + e)^4 -
 5*(a + 4*b)*cos(f*x + e)^2 + 8*b)/(cos(f*x + e)^5 - 2*cos(f*x + e)^3 + cos(f*x + e)))/f

________________________________________________________________________________________

mupad [B]  time = 11.97, size = 138, normalized size = 1.75 \[ \frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a}{8}+\frac {b}{8}\right )}{f}-\frac {\left (-2\,a-34\,b\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (\frac {7\,a}{4}+2\,b\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+\frac {a}{4}}{f\,\left (16\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4-16\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (\frac {3\,a}{8}+\frac {3\,b}{2}\right )}{f}+\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4}{64\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x)^2)/sin(e + f*x)^5,x)

[Out]

(tan(e/2 + (f*x)/2)^2*(a/8 + b/8))/f - (a/4 + tan(e/2 + (f*x)/2)^2*((7*a)/4 + 2*b) - tan(e/2 + (f*x)/2)^4*(2*a
 + 34*b))/(f*(16*tan(e/2 + (f*x)/2)^4 - 16*tan(e/2 + (f*x)/2)^6)) + (log(tan(e/2 + (f*x)/2))*((3*a)/8 + (3*b)/
2))/f + (a*tan(e/2 + (f*x)/2)^4)/(64*f)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{5}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**5*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*csc(e + f*x)**5, x)

________________________________________________________________________________________